package service;

import URL.Constants;
import bean.HotVideComm;
import bean.HotVideo;
import com.alibaba.fastjson.JSONObject;

import requerst.HttpUt;

import java.util.List;

public class HotVideoService {
/**
 * 用于获取热门数据，并将数据返回
 * @author: dae
 * @email: 675116529@qq.com
 * @phone: 15270029507
 * @DateTime: 2021/12/7 15:23
 *
 * @return*/

              public List<HotVideo> getHotVideo(){


                     String url = Constants.Trip_url
                             + "?key=" + Constants.Trip_key
                             + "&type= hot_video"
                             + "&size="+Constants.size;
                     String result =  HttpUt.get(url);
                     //System.out.println(result);
                     //json解析
                     HotVideComm VideComm = JSONObject.parseObject(result, HotVideComm.class );
                     return  VideComm.result;


       }

}
